class CamtsController < ApplicationController
  # GET /camt
  # GET /camt.xml
  def index
    @camts = Camt.all

    respond_to do |format|
      format.html # index.html.erb
      format.xml  { render :xml => @camts }
    end
  end

  # GET /camt/1
  # GET /camt/1.xml
  def show
    @camt = Camt.find(params[:id])

    respond_to do |format|
      format.html # show.html.erb
      format.xml  { render :xml => @camt }
    end
  end

  # GET /camt/new
  # GET /camt/new.xml
  def new
    @camt = Camt.new

    respond_to do |format|
      format.html # new.html.erb
      format.xml  { render :xml => @camt }
    end
  end

  # GET /camt/1/edit
  def edit
    @camt = Camt.find(params[:id])
  end

  # POST /camt
  # POST /camt.xml
  def create
    @camt = Camt.new(params[:camt])

    respond_to do |format|
      if @camt.save
        format.html { redirect_to(@camt, :notice => 'Camt was successfully created.') }
        format.xml  { render :xml => @camt, :status => :created, :location => @camt }
      else
        format.html { render :action => "new" }
        format.xml  { render :xml => @camt.errors, :status => :unprocessable_entity }
      end
    end
  end

  # PUT /camt/1
  # PUT /camt/1.xml
  def update
    @camt = Camt.find(params[:id])

    respond_to do |format|
      if @camt.update_attributes(params[:camt])
        format.html { redirect_to(@camt, :notice => 'Camt was successfully updated.') }
        format.xml  { head :ok }
      else
        format.html { render :action => "edit" }
        format.xml  { render :xml => @camt.errors, :status => :unprocessable_entity }
      end
    end
  end

  # DELETE /camt/1
  # DELETE /camt/1.xml
  def destroy
    @camt = Camt.find(params[:id])
    @camt.destroy

    respond_to do |format|
      format.html { redirect_to(camts_url) }
      format.xml  { head :ok }
    end
  end
end
